<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="../utils/react.development.js"></script>
<!--react的扩展库，专门用于操作DOM-->
<script type="text/javascript" src="../utils/react-dom.development.js"></script>
<!--引入babel，用于解析jsx语法为原生js语法-->
<script type="text/javascript" src="../utils/babel.min.js"></script>

<script type="text/babel">
    let arr=[1,2,3,4]
    function MyComponent(props){
        const {name}=props
        return (
            <ul>
                <div>{name}</div>
                {arr.map(item=>{
                    return <li key={item}>{item}</li>
                })}
            </ul>
        )
    }
    let obj={name:"函数式组件"}
    ReactDOM.render(<MyComponent {...obj}/>,document.querySelector('#app'))
</script>
</body>
</html>
